<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://java.sun.com/jsf/composite/components/property"
	xmlns:s="http://jboss.org/seam/faces"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/resources/forge-template.xhtml">
	<ui:define name="metadata">
		<f:metadata>
			<f:viewParam name="id" value="#{postEditAction.postId}" />
			<s:viewAction action="#{postEditAction.init()}" />
		</f:metadata>
	</ui:define>/>

	<ui:param name="pageTitle" value="Create Tag" />

	<ui:define name="header">
		New Post
	</ui:define>

	<ui:define name="subheader">
		Create a new post, required fields are marked with "*".
	</ui:define>

	<ui:define name="footer">
	</ui:define>

	<ui:define name="main">
		<h:form id="form">

			<h:messages globalOnly="true" showSummary="true" />

			<p:input id="title" label="Title" required="true">
				<h:inputText id="input" value="#{postEditAction.currentPost.title}"
					required="true" />
			</p:input>
			<p:input id="content" label="Content" required="true">
				<h:inputTextarea id="input" style="width: 350px" rows="10"
					value="#{postEditAction.currentPost.content}" required="true" />
			</p:input>

			<p:input id="tags" label="Tags" required="true">
				<h:selectManyCheckbox id="input"
					value="#{postEditAction.currentPost.tags}"
					collectionType="java.util.ArrayList">
					<f:selectItems value="#{tags}" var="t" itemLabel="#{t.name}">
					</f:selectItems>
					<s:objectConverter />
				</h:selectManyCheckbox>
			</p:input>
			<br />

			<h:commandButton value="Create" action="#{postEditAction.save()}" />
			<h:commandButton value="Create 2" action="#{postEditAction.save2()}" />
			<h:commandButton value="Create 3" action="#{postEditAction.save3()}" />
			<h:commandButton value="Create 4" action="#{postEditAction.save4()}" />
			<h:commandButton value="Cancel" immediate="true"
				action="#{postEditAction.cancel()}" />


			<a4j:commandButton execute="@this" render="outputPane"
				value="Ajax Button" action="#{postEditAction.ajaxButton()}" />

		</h:form>
		<h:panelGroup id="outpuPane">
			#{postEditAction.ajaxDateTime}
		</h:panelGroup>
	</ui:define>

	<ui:define name="left">
		<h3>Get involved</h3>
		<p>
			If you would like to get involved in this project, please visit the <a
				href="http://bit.ly/seamforge">Forge homepage</a> or visit the
			#seam-dev IRC channel: <a href="irc://chat.freenode.net/#seam-dev">freenode.net#seam-dev</a>
			and ask about "Forge"
		</p>
		<p>
			If you have an idea for a plugin or improvement, and would like to do
			some "forgestorming", submit it <a href="http://bit.ly/forgestorm">here</a>.
		</p>

		<h3>Useful links</h3>
		<ul>
			<li>Seam 3: <a href="http://seamframework.org/Seam3">Home</a></li>
			<li>JBoss.org: <a href="http://jboss.org">Home</a></li>
		</ul>
	</ui:define>

</ui:composition>

